<script src="/statics/js/layer.js"></script>
<!-- 头部开始 -->
<div class="header">
	<div class="header_l"><a href="javascript:history.back(-1);"></a></div>
	<div class="header_m">我的收藏</div>
</div>
<!-- 头部结束 -->

<!--收藏开始-->
<div class="collection">
  <?php if($data){?>
	<foreach name="data" item="vo" >
		<dl>
			<dt><a href="/goods/detail/id/{{$vo.goods_id}}/sek/<?=$sek?>"><img src="{{$vo.goods_pic}}" width="100%"></a></dt>
			<dd class="collection-dd1"><a href="/goods/detail/id/{{$vo.goods_id}}/sek/<?=$sek?>">{{$vo.goods_title}}</a><br /><span>￥{{$vo.goods_price}}</span></dd>
			<dd class="collection-dd2">
				<span class="removeIt"></span>
				<input type="hidden" value="{{$vo.goods_id}}" name="goods_id" class="goods_id" />
			</dd>
		</dl>
   </foreach>
  <?php }else{?>
     <center  style="margin-top:40px;margin-bottom:40px;font-size:12px;">暂无收藏</center>
  <?php } ?>
</div>
<!--收藏结束-->

<div class="fiex nav"> <a class="icon-shouye" href="/index/index/sek/<?=$sek?>"><br>
  首页</a> <a class="icon-fenlei" href="/cate/main/sek/<?=$sek?>"><br>
  分类</a> <a class="icon-gouwu" href="/cart/index/sek/<?=$sek?>"><span id="cartSum"></span><br>
  购物车</a> <a class="icon-geren  fiex_on" href="/index/user/sek/<?=$sek?>"><br>
  用户中心</a> </div>

<script type="text/javascript">
$(function(){
	cartSum();
});
$('.removeIt').click(function(){
		_this = $(this);
		layer.confirm('确定删除该收藏吗？', {
			btn: ['确定','取消'] //按钮
				}, function(){
				    var goods_id = $(".goods_id").val();
					$.get('/goods/coldel',{'goods_id':goods_id,'del':1},function(data){
				        if(data ==1){
						    layer.msg('删除成功', {icon: 1});
							setTimeout(function(){location.reload();},1000);
						}else if(data ==0){
						    layer.msg('删除失败', {icon: 0});
						}
					
					})
				});
			return false;
		});
</script>
